package com.qys.livesMall.app.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qys.livesMall.app.user.model.entity.UserRewardHistory;
import com.qys.livesMall.app.user.mapper.UserRewardHistoryMapper;
import com.qys.livesMall.app.user.service.UserRewardHistoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qys.livesMall.finance.enums.AccountBusinessTypeEnum;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户奖励历史记录表 服务实现类
 * </p>
 *
 * @author 
 * @since 2023-11-02
 */
@Service
public class UserRewardHistoryServiceImpl extends ServiceImpl<UserRewardHistoryMapper, UserRewardHistory> implements UserRewardHistoryService {

    @Override
    public List<UserRewardHistory> getUserRewardHistory(Long userId, String type, Long conId) {
        LambdaQueryWrapper<UserRewardHistory> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.eq(UserRewardHistory::getUserId,userId);
        queryWrapper.eq(UserRewardHistory::getType,type);
        queryWrapper.eq(null !=conId,UserRewardHistory::getCorrespondingId,conId);
        List<UserRewardHistory> list=list(queryWrapper);
        return list;
    }
}
